package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.Connection;
import java.sql.SQLException;

public class Demo2 {
    public static void main(String[] args) throws SQLException {
        AnnotationConfigApplicationContext  context = new AnnotationConfigApplicationContext("demo7");
        DBUtil  dbUtil = context.getBean(DBUtil.class);
        Connection connection = dbUtil.getConnection();
        System.out.println(connection);
    }
}
